From 54b14199520776fd285db6bd269f595be471e1fc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 16 Jan 2014 23:58:49 -0500 Subject: [PATCH] dialog: Show the action area when needed If we find that widgets are being added to the action area, we should show it. Also warn in this situation. --- gtk/gtkdialog.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 90eeabc1f9..fa52c77b25 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -258,6 +258,19 @@ gtk_dialog_set_use_header_bar_from_setting (GtkDialog *dialog) NULL); } +static void +add_cb (GtkContainer *container, + GtkWidget *widget, + GtkDialog *dialog) +{ + GtkDialogPrivate *priv = dialog->priv; + + if (priv->use_header_bar) + g_warning ("Content added to the action area of a dialog using header bars"); + + gtk_widget_show (GTK_WIDGET (container)); +} + static void apply_use_header_bar (GtkDialog *dialog) { @@ -267,6 +280,8 @@ apply_use_header_bar (GtkDialog *dialog) gtk_widget_set_visible (priv->headerbar, priv->use_header_bar); if (!priv->use_header_bar) gtk_window_set_titlebar (GTK_WINDOW (dialog), NULL); + if (priv->use_header_bar) + g_signal_connect (priv->action_area, "add", G_CALLBACK (add_cb), dialog); } static void -- 2.30.2